<?php

namespace services;
/*

require 'library/define.php';

require_once ROOT_LIBRARY_RESTFUL . DS . 'restful.php';
require_once ROOT_LIBRARY_DB . DS . 'PDOWrapper.php';
require_once ROOT_LIBRARY_APC . DS . 'fileCache.php';
require_once ROOT_LIBRARY_APC . DS . 'wrapperCache.php';

require_once ROOT_SERVICES_MODEL . DS . 'oms.php';
require_once ROOT_SERVICES_MODEL . DS . 'rule.php';
require_once ROOT_SERVICES_MODEL . DS . 'location.php';
require_once ROOT_SERVICES . DS . 'delivery_promises.php';

use services\models as models;

$sku = 'abc123';
$location = 'HP';

$config = include ROOT_CONFIG;
$db = \PDOWrapper::instance();
$db->configMaster($config['db']['master']);
$cache = \wrapperCache::GetInstance($config['apc_cache']['cache_type'], $config['apc_cache']['cache_expire'], $config['apc_cache']['cache_path']);

var_dump($db->getPDOException());


$oms = new models\oms($cache);
$rule_model = new models\rule($db, $cache);
$location_model = new models\localtion($db, $cache);


try {
    $delivery = new delivery_promises($cache, $oms, $location_model, $rule_model);
    $result = $delivery->get_time($sku, $location);
} catch (\PDOException $pe) {
    //var_dump($pe);

    echo 'test';
}
*/


$strApi = 'http://localhost/lazada/shipping-time/get_time_shipping';

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $strApi);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, 'sku=abc123&location=HCM');
$store = curl_exec($ch);

var_dump($store);


?>


